<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of welcome
 *
 * @author Obi
 */
class Admin_member extends MY_Controller {

    function __construct() {
        parent::__construct();

        $cek_admin = $this->session->userdata('cek_admin');
        if (!$cek_admin)
            redirect("admin");

        $this->mmember = new M_member();
    }

    function index() {
        $data['title'] = 'Data Member';
        $data['list_member'] = $this->mmember->get();
        $data['isi'] = 'isi';
        $this->load->view('template_admin', $data);
    }

    function detail($id) {
        $data['title'] = 'Data Detail Member';
        $data['list'] = $this->mmember->get_detail($id);
        $data['isi'] = 'isi_det';
        $this->load->view('template_admin', $data);
    }

    function status($id, $status) {
        $data = array(
            'status' => $status,
        );
        $this->mmember->update($data, $id);
        redirect('admin_member');
    }

    function delete($id) {
        $this->mmember->delete($id);
        redirect('admin_member');
    }

}

?>
